<template>
  <van-list
    v-model:loading="loading"
    :finished="finished"
    finished-text="没有更多了"
  >
    <van-cell
      v-for="memoItem in list"
      :key="memoItem.id"
      :title="memoItem.title"
      clickable
      @click="router.push(`/memo/${memoItem.id}`)"
    >
      <template #right-icon>
        <van-icon name="cross" @click.stop="deleteMemo(memoItem.id)" />
      </template>
    </van-cell>
  </van-list>
</template>

<script setup>
import { useMemoList } from './useMemoList.js';

const { list, loading, finished, router, deleteMemo } = useMemoList();
</script>
